// 卡证采集
export const cardCollection = {
	name: '',
	do: {
		data: '',
		command: 'speak',
		variables: [],
		variableId: ''
	},
	cardType: '', // 卡证类型 'ID-card' || 'bank-card'
	timeout: 0, // 等待时长
	id: '',
	no: '',
	name: '',
	type: 'cardCollection',
	openOCR: false, // 开启OCR
	identifyResult: [
		// 识别结果 TODO 识别结果待定
		// {
		// 	name: '身份证号',
		// 	fieldName: '待定', // TODO 待定
		// 	parameterName: '{{客户信息_访客_客户ID_1376}}' // 参数名 绑定的变量
		// }
	],
	after: {
		data: {
			data: {
				cmd: 'card-collection'
			},
			type: 'peer-cmd'
		},
		after: {
			command: 'receive-message'
		},
		command: 'send-message'
	},
	answer: [
		{
			do: {
				data: '',
				command: 'speak',
				variables: [],
				variableId: ''
			},
			key: ['ok'],
			type: 'yes',
			after: {
				id: '',
				no: '',
				type: 'yes',
				command: 'jump-to'
			}
		},
		{
			do: {
				data: '',
				command: 'speak',
				variables: [],
				variableId: ''
			},
			key: [
				// TODO 也可以是no
				'no'
			],
			type: 'no',
			after: {
				id: '',
				no: '',
				type: 'no',
				command: 'jump-to'
			}
		},
		{
			do: {
				data: '',
				command: 'speak',
				variables: [],
				variableId: ''
			},
			key: ['timeout'],
			type: 'other',
			after: {
				data: '',
				command: 'to-compare-answer'
			}
		},
		{
			do: {
				data: '',
				command: 'speak',
				variables: [],
				variableId: ''
			},
			key: ['unrecognized'],
			type: 'unrecognized'
		}
	],
	errorRemind: {
		do: {
			data: '采集超时超过最大次数',
			command: 'speak',
			variables: [],
			variableId: ''
		},
		type: 'other',
		after: {
			id: '',
			no: '',
			type: 'unrecognized',
			command: 'jump-to'
		},
		maximum: 3,
		timeout: 8000
	},
	identifyError: {
		// 识别失败
		maximum: 3,
		do: {
			data: '识别失败超过最大次数',
			command: 'speak',
			variables: [],
			variableId: ''
		},
		after: {
			id: '',
			no: '',
			type: 'unrecognized',
			command: 'jump-to'
		}
	}
};
